// client.cpp
#define _WIN32_DCOM
#include <iostream.h>
#include <stdio.h>
#include "Component\component.h"

void main()
{
	CoInitialize(NULL);

	cout << "1" << endl;

	IPointerTest* pTest;
	HRESULT hr = CoCreateInstance(CLSID_PointerTest, NULL, CLSCTX_LOCAL_SERVER, IID_IPointerTest, (void**)&pTest);
	printf(" result  %0x\n", hr);

	IPointerTest* pReturnedInterfacePointer;

//  For inproc only
//	pTest->GetInterfacePointer1((void**)&pReturnedInterfacePointer);
//	pReturnedInterfacePointer->Release();

		cout << "3" << endl;

	pTest->GetInterfacePointer2(IID_IPointerTest, (IUnknown**)&pReturnedInterfacePointer);
	pReturnedInterfacePointer->Release();

		cout << "4" << endl;

	pTest->GetInterfacePointer3(&pReturnedInterfacePointer);
	pReturnedInterfacePointer->Release();

		cout << "5" << endl;

	pTest->GetInterfacePointer4(IID_IPointerTest, (void**)&pReturnedInterfacePointer);
	pReturnedInterfacePointer->Release();

		cout << "6" << endl;

	pTest->Release();
	CoUninitialize();
}